package brokerFailureSuperController;

import java.util.HashMap;

import brokerFailureController.Controller;

/**
 * Creates a controller.
 */
public class ControllerCreatorThread extends Thread {
	
	//IP address of the broker controller (= IP address of the controller)
	String controllerIP;
	//list of the IP addresses of the brokers in the system mapped to the ports
	//in which they are listening
	HashMap<String, Integer> brokerAddresses;
	
	/**
	 * Constructor.
	 * 
	 * @param controllerIP  IP of the broker controller
	 * @param brokerAddresses  list of the IP addresses of the brokers in the
	 * 						   system mapped to the ports in which they are
	 * 						   listening
	 */
	public ControllerCreatorThread(String controllerIP,
			 					   HashMap<String, Integer> brokerAddresses) {
		
		this.controllerIP = controllerIP;
		this.brokerAddresses = brokerAddresses;
    	
    	start();
    	
    }
	
	/**
	 * Create a controller.
	 */
	public void run() {
		new Controller(controllerIP, brokerAddresses);
	}

}
